﻿

// 自定义双击查看
var CustomDbClick = function () {
    var recordID = myDataTable.getSelectedRows()[0],
        record = myDataTable.getRecord(recordID);
    const_EditEntity = "V_BH_AccountsReceivable";
    initFlag = (record.getData("InitFlag") == "True") ? "1" : "0";
    var pagetitle = "查看应收" + ((initFlag == "1") ? "手动" : "") + "结算—" + record.getData("AccountsReceivableNo");
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, "/Extend/AutoLoadForm.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&actionFlag=3&initFlag=" + initFlag + "&id=" + record.getData("ID"));
    //parent.addTabs(pagetitle, "/Extend/AutoLoadForm.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&read=true&id=" + record.getData("ID"));
}

// 新增手动结算
var fnInitAccountsReceivable = function () {
    const_EditEntity = "V_BH_AccountsReceivable";
    var pagetitle = "新增应收手动结算";
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&actionFlag=1&initFlag=1"));
    parent.NeedRefreshPage = this;
}

// 自定义新增
var fnCustomAdd = function () {
    const_EditEntity = "V_BH_AccountsReceivable";
    var pagetitle = "新增应收结算";
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&actionFlag=1&initFlag=0"));
    parent.NeedRefreshPage = this;
}

// 自定义修改
var fnCustomEdit = function () {
    alert("当前业务不能进行修改操作！");
    return;

    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    const_EditEntity = "V_BH_AccountsReceivable";
    var pagetitle = "修改应收结算—" + record.getData("AccountsReceivableNo");
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&actionFlag=2"));
    parent.NeedRefreshPage = this;

}

// 自定义删除
var fnCustomDelete = function () {
    alert("当前业务不能进行删除操作！");
    return;
}
